﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Client.Models
{
    //查询结算是否超合同金额实体
    public class GcjsbDtlCBM
    {
        /// <summary>
        /// 结算清单id
        /// </summary>
        public string? DtlId { get; set; }
        /// <summary>
        /// 清单名称
        /// </summary>
        public string ? XmName { get; set; }
        /// <summary>
        /// 细目号
        /// </summary>
        public string ? XmCode { get; set; }
        /// <summary>
        /// 本期结算金额
        /// </summary>
        public string? monthAmount { get; set; }
        /// <summary>
        /// 累积结算金额
        /// </summary>
        public string? LeiJiAmount { get; set; }
        /// <summary>
        /// 合同金额
        /// </summary>
        public string? ContractAmount { get; set; }
        /// <summary>
        /// 合同已经结算金额
        /// </summary>
        public string? SettledAmount { get; set; }
        /// <summary>
        ///  合同剩余结算金额
        /// </summary>
        public string? ResidueAmount { get; set; }
        /// <summary>
        /// 累积数量
        /// </summary>
        public string? LeiJiQty { get; set; }

        /// <summary>
        /// 合同累积数量
        /// </summary>
        public string? SettledQty { get; set; }
        /// <summary>
        /// 是否正常
        /// </summary>

        private bool IsCash_;

        public bool IsCash
        {
            get {
                
                return Decimal.Parse(string.IsNullOrWhiteSpace(ContractAmount)?"0": ContractAmount) - Decimal.Parse(string.IsNullOrWhiteSpace(LeiJiAmount) ? "0" : LeiJiAmount) <0; 
            }
            set { IsCash_ = value; }
        }

        /// <summary>
        /// 是否超合同
        /// </summary>
        private bool IsCash1_;

        public bool IsCash1
        {
            get { return Decimal.Parse(string.IsNullOrWhiteSpace(ResidueAmount)?"0": ResidueAmount) <0; }
            set { IsCash1_ = value; }
        }

    }
}
